const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.BIGINT.UNSIGNED,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "自增id",
      field: "id"
    },
    transfer_no: {
      type: DataTypes.CHAR(60),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "转账单号",
      field: "transfer_no"
    },
    send_user_id: {
      type: DataTypes.INTEGER(11).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "发起用户id",
      field: "send_user_id"
    },
    send_wallet_id: {
      type: DataTypes.INTEGER(11).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "发起钱包id",
      field: "send_wallet_id"
    },
    receive_user_id: {
      type: DataTypes.INTEGER(11).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "接收用户id",
      field: "receive_user_id"
    },
    receive_wallet_id: {
      type: DataTypes.INTEGER(11).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "接收钱包id",
      field: "receive_wallet_id"
    },
    money: {
      type: DataTypes.DECIMAL,
      allowNull: false,
      defaultValue: "0.00",
      primaryKey: false,
      autoIncrement: false,
      comment: "金额",
      field: "money"
    },
    note: {
      type: DataTypes.CHAR(230),
      allowNull: false,
      defaultValue: "",
      primaryKey: false,
      autoIncrement: false,
      comment: "备注",
      field: "note"
    },
    add_time: {
      type: DataTypes.INTEGER(11).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "添加时间",
      field: "add_time"
    }
  };
  const options = {
    tableName: "sxo_plugins_wallet_transfer",
    comment: "",
    indexes: [{
      name: "transfer_no",
      unique: false,
      type: "BTREE",
      fields: ["transfer_no"]
    }, {
      name: "send_user_id",
      unique: false,
      type: "BTREE",
      fields: ["send_user_id"]
    }, {
      name: "send_wallet_id",
      unique: false,
      type: "BTREE",
      fields: ["send_wallet_id"]
    }, {
      name: "receive_user_id",
      unique: false,
      type: "BTREE",
      fields: ["receive_user_id"]
    }, {
      name: "receive_wallet_id",
      unique: false,
      type: "BTREE",
      fields: ["receive_wallet_id"]
    }, {
      name: "money",
      unique: false,
      type: "BTREE",
      fields: ["money"]
    }]
  };
  const SxoPluginsWalletTransferModel = sequelize.define("sxo_plugins_wallet_transfer_model", attributes, options);
  return SxoPluginsWalletTransferModel;
};